FROM docker.io/node:18-alpine AS builder
LABEL version="0.2.1"

WORKDIR /usr/app

COPY . /usr/app/

RUN npm ci
RUN npm run build

FROM docker.io/nginxinc/nginx-unprivileged:alpine
EXPOSE 8080

COPY ./container/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /usr/app/build /usr/share/nginx/html
